package org.massdgames.thunder.server.domain;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import com.google.inject.Inject;


public class SimpleDeckLoader implements DeckLoader {

    private DeckSet deckSet;
    
    @Inject
    public SimpleDeckLoader(DeckSet deckSet) {
        this.deckSet = deckSet;
    }
    
    public DeckSet load() throws IOException {
        Properties properties = new Properties();
        properties.load(new FileInputStream("deck.properties"));

        DungeonDeck dungeonDeck = deckSet.getDungeonDeck();
        HeroDeck heroDeck = deckSet.getHeroDeck();
        VillageDeck villageDeck = deckSet.getVillageDeck();
        FeatureDeck featureDeck = deckSet.getFeatureDeck();
        GuardianDeck guardianDeck = deckSet.getGuardianDeck();
        ThunderstoneDeck thunderstoneDeck = deckSet.getThunderstoneDeck();
        
        dungeonDeck.load();
        heroDeck.load();
        villageDeck.load();
        featureDeck.load();
        guardianDeck.load();
        thunderstoneDeck.load();

        return deckSet;
    }
}
